package com.baofu.paycore.service.processor.transfer;

import com.baofu.paycore.manager.model.TransferBO;
import com.baofu.paycore.service.converter.DTO2BOConverter;
import com.baofu.paycore.service.facade.model.transfer.CancelTransferDTO;
import com.baofu.paycore.service.processor.PayBaseProcessor;
import org.springframework.stereotype.Component;

/**
 * 转账撤销主单处理类
 *
 * <p/>
 *      1、构建支付属性
 * </p>
 * User: LZQ Date: 2016/04/20  Version: 1.0
 */
@Component
public class CancelTransferProcessor implements PayBaseProcessor<TransferBO,CancelTransferDTO> {

    /**
     * 构建支付属性
     *
     * @param transferBO      支付模型
     * @param transferDTO     请求参数
     */
    @Override
    public PayBaseProcessor process(TransferBO transferBO, CancelTransferDTO transferDTO) {

        DTO2BOConverter.getTransferBOByDTO(transferDTO, transferBO);
        transferBO.setPayNo(transferBO.getPayNo());
        transferBO.setOldPayNo(transferBO.getOldTransferBO().getPayNo());
        return  this;
    }
}
